<!DOCTYPE html>

<html>

    <head>

        <meta charset="utf-8">

        <title>

            字段添加/修改

        </title>

        <meta name="renderer" content="webkit">

        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

        <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

        <meta name="apple-mobile-web-app-status-bar-style" content="black">

        <meta name="apple-mobile-web-app-capable" content="yes">

        <meta name="format-detection" content="telephone=no">

        <link href="__PUBLIC__/skin/nei.css" type="text/css" rel="stylesheet">

    </head>

</head>

<body onLoad="initPage()">

<div id="LoadingBar"><img src="images/load.gif" /></div>

<div class="d_contaiter">

<form class="layui-form layui-form-pane" action="{:url('admin/admin/edit')}" method="post" enctype="multipart/form-data">

  <div class="layui-form-item">

    <label class="layui-form-label">用 户 名</label>

    <div class="layui-input-block">

      <input type="hidden" name="id" value="{$data.id}">

      <input type="text" name="name" value="{$data.ma_n}" lay-verify="required" autocomplete="off" placeholder="请输入标题" class="layui-input">

    </div>

  </div>
  <div class="layui-form-item">
    <label class="layui-form-label">管理员身份</label>
    <div class="layui-input-block">
      <select name="lever" id="lever" lay-filter="lever">
        {volist name="$groupRes" id="vo"}
        <option value="{$vo.id}"  {if condition="$data.ma_l eq $vo.id"} selected="selected" {/if}>{$vo.name}</option>
        {/volist}
      </select>
    </div>
  </div>
  <div class="layui-form-item">
    <button class="layui-btn layui-btn-green" type="submit">提交修改</button>
  </div>

</form>

</div>

<script src="__PUBLIC__/js/jquery-1.10.2.min.js" type="application/javascript"></script>

<script src="__PUBLIC__/js/neijqtab.js" type="application/javascript"></script>

<script src="__PUBLIC__/js/xlayui/layui.js" charset="utf-8"></script>

<script>

function initPage(){

	var objLoading = document.getElementById("LoadingBar");

	if (objLoading != null){

		objLoading.style.display = "none";

		$(".d_contaiter").css("display","block");

	}

}

</script>

<script>

  layui.use(['form'], function(){

    var form = layui.form()

    ,layer = layui.layer;

    //监听超级管理员和普通管理员

    form.on('select[lever])', function(data){

        alert(11111111);

        return false;

    });

    form.on('select(proid)', function(data){  


      $.ajax({


          url:"{:url('admin/city/getcity')}",


          dataType:"json",


          async:true,


          data:{keyid:data.value},


          type:"POST",


          beforeSend:function(){


              


          },


          success:function(res){


             var data = res.data;


             var html= "";


             //循环输出数据


             html += '<option value="">搜索或直接选择</option>'; 


             for(var i in data){  


                html += '<option value="'+data[i].id+'">'+data[i].name+'</option>';


             } 


             //赋值


             $("#cityid").html(html);


             form.render(); //从新渲染表单


          },


          complete:function(){


              //请求完成的处理


              


          },


          error:function(){


             alert('请求出错');


          }


      });


  }); 

  });

</script>

</body>

</html>